package se.gala.wallet;

import java.util.HashMap;
import java.util.Set;

import se.gala.utils.EnumMap;

public enum BalanceTypes implements EnumMap {
	None(),
	CashPlayable(),
	BonusPlayable(),
	//
	;
	
	private static HashMap<String, BalanceTypes> map;
	
	private BalanceTypes() {
		registerSelf();
	}
	
	public static BalanceTypes getTypeByKey(String key) {
		return map.get(key);
	}
	
	public void registerSelf() {
		if (map == null) {
			map = new HashMap<String, BalanceTypes>();
		}
		map.put(this.name(), this);
	}
	
	@Override
	public Set<String> getNamesSet() {
		return map.keySet();
	}
	
	@Override
	public EnumMap getMapEntry(String key) {
		return getTypeByKey(key);
	}

}
